from moviepy.editor import *
import re

def split_video(video_path,file_name,type):
    path_str = ''
    paths = video_path.split('\\')
    paths.pop()
    for p in paths:
        path_str += p + '\\'
    name = file_name.split('.')[0]
    path_str += name + '.' + type
    print(video_path)
    print(path_str)
    video = VideoFileClip(video_path)
    video.audio.write_audiofile(path_str)
    return path_str